all: b1_sniffer urouter udp_sniffer udp_hello udp_chat ub_debug

### NO COMMUNICATION ###
ub_debug: ub_debug.o uBroadcast.o
	gcc -o ub_debug ub_debug.o uBroadcast.o

### BUGONE SAMPLES ###
b1_sniffer: b1_sniffer.o uBroadcast.o uBroadcast_B1.o
	gcc -o b1_sniffer b1_sniffer.o uBroadcast.o uBroadcast_B1.o

### UDP SAMPLES ###
udp_sniffer: udp_sniffer.o uBroadcast.o uBroadcast_UDP.o
	gcc -o udp_sniffer udp_sniffer.o uBroadcast.o uBroadcast_UDP.o

udp_hello: udp_hello.o uBroadcast.o uBroadcast_UDP.o
	gcc -o udp_hello udp_hello.o uBroadcast.o uBroadcast_UDP.o

udp_chat: udp_chat.o uBroadcast.o uBroadcast_UDP.o
	gcc -o udp_chat udp_chat.o uBroadcast.o uBroadcast_UDP.o

### ROUTER ###
urouter: urouter.o uBroadcast.o uBroadcast_UDP.o uBroadcast_B1.o
	gcc -o urouter urouter.o uBroadcast.o uBroadcast_UDP.o uBroadcast_B1.o

### GENERIC RULES ###
%.o: %.c
	gcc -I. -o $@ -c $<

### CLEAN ###
clean:
	rm -f *.o main b1_sniffer udp_sniffer udp_hello urouter